from common.tools import Tool
from msg.order import Order

nvr = {

    # "34020000001110009999": [
    #     "34020000001320000001"
    # ]
    # ,
    '34020000001110000002': [  # 俏四方
        "34020000001320000001",
        "34020000001320000002",
        "34020000001320000003",
        "34020000001320000004",
        "34020000001320000005",
        "34020000001320000006",
        "34020000001320000007",
        "34020000001320000008",
    ],
    '34020000001180000001': [  # 新宝航北厂西库
        "34020000001320000001",
        "34020000001320000002",
    ],

    '34020000001180000003': [  # 新宝航南3-4号库
        "34020000001320000001",
        "34020000001320000002",
        "34020000001320000003",
    ]
}


def invite_all():
    a = Order()
    for cid, chans in nvr.items():
        for chan in chans:
            # print(cid, chan)
            ssrc = Tool().from_camId_chanId_to_ssrc(cid, chan)
            print("ssrc==", cid, chan, ssrc)
            a.invite_remote(cid, chan)


def bye_all():
    a = Order()
    for cid, chans in nvr.items():
        for chan in chans:
            # print(cid, chan)
            ssrc = Tool().from_camId_chanId_to_ssrc(cid, chan)
            print("ssrc==", cid, chan, ssrc)
            a.bye_remote(cid, chan)


if __name__ == '__main__':
    # bye_all()
    invite_all()
